<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="/Static/Css/reset.css" />
<link rel="stylesheet" type="text/css" href="/Static/Css/zh-cn-system.css" />
<link rel="stylesheet" type="text/css" href="/Static/Css/table_form.css" />
<script src="/Public/js/jquery.min.js"></script>
<script src="/Public/js/jquery.form.js"></script>
<script src="/Public/js/main.js"></script>
<script type="text/javascript" src="/Public/artDialog/jquery.artDialog.js?skin=default"></script>
<script type="text/javascript" src="/Public/artDialog/plugins/iframeTools.js"></script>
</head>
<body>

<body>
<form name="myform" id="myform" method="post" action="">
  <input name="id" type="hidden" value="<?php echo ($info['id']); ?>">
  <fieldset>
    <legend>基本信息</legend>
    <table class="table_form" width="100%" cellspacing="0">
      <tbody>
        <tr>
          <th width="20%">菜单级别：</th>
          <td>
          <select name="data[pid]" id="pid" >
              <option value="0" selected >顶级菜单</option>
              <?php $_result=get_admin_menu_list();if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo["id"]); ?>" ><?php echo ($vo["fullname"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
            </select>
          </td>
        </tr>
        <tr>
          <th>菜单名称：</th>
          <td><input name="data[name]" id="name" class="input-text" type="text" size="20" value="<?php echo ($info["name"]); ?>">
            </td>
        </tr>
        <tr>
          <th>操作名：</th>
          <td><input name="data[c]" id="model" class="input-text" type="text" size="20" value="<?php echo ($info["c"]); ?>">
            </td>
        </tr>
        <tr>
          <th>方法名：</th>
          <td><input name="data[a]" id="fun" class="input-text" type="text" size="20" value="<?php echo ($info["a"]); ?>">
            </td>
        </tr>
        <tr>
          <th>参数：</th>
          <td><input name="data[parameter]" id="fun" class="input-text" type="text" size="20" value="<?php echo ($info["parameter"]); ?>">
            </td>
        </tr>
        <tr>
          <th>状态：</th>
          <td>
          	<input name="data[status]" type="radio" value="1" checked />启动
            <input name="data[status]" type="radio" value="0" />禁用
          </td>
        </tr>
        <tr>
          <th class="last">排序：</th>
          <td>
          	<input name="data[sort]" id="sort" class="input-text" type="text" size="10" value="<?php echo ($info["sort"]); ?>">注：数值越小越靠前
          </td>
        </tr>
        <!-- <tr class="last">
          <th>分组：</th>
          <td>
            <label><input name="group[]" id="group" type="checkbox" value="2" <?php echo ($group['2']); ?>><span>&nbsp;高级顾问</span></label>&nbsp;
            <label><input name="group[]" id="group" type="checkbox" value="3" <?php echo ($group['3']); ?>><span>&nbsp;留学顾问</span></label>&nbsp;
            <label><input name="group[]" id="group" type="checkbox" value="4" <?php echo ($group['4']); ?>><span>&nbsp;普通顾问</span></label>
          </td>
        </tr> -->
      </tbody>
    </table>
  </fieldset>
  <input type="submit" value="提交" class="dialog"  id="dosubmit">
</form>
</body>
</html>
<script type="text/javascript">
$(function(){
	$('#myform').ajaxForm({
		beforeSubmit:  checkForm,
		success:       complete,
		dataType: 'json'
	});

	function checkForm(){
		if($('#name').val().length < 2){
			$('#name').focus();
			art.dialog({id:'TNCICC',content: '菜单名称不能少于2个字符！',time: 2,icon:'succeed'});
			return false;
		}
		return true;
	}

	var origin = $.artDialog.open.origin;
    function complete(data){
		art.dialog({id:'TNCICC',content: data.info,time: 2,icon:'succeed'});
		if( data.status==1 ){
			setTimeout(function(){origin.location.reload();},1000);
			closeWin(1500);
		}
    }

	  $("#pid").val("<?php echo ($info["pid"]); ?>");
})

</script>